|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.beans.PropertyEditorSupport
com.virtualweaver.xotics.datamodel.editor.XoAbstractPropertyEditor
This class implements an abstract PropertyEditor implementing interface XoPropertyEditor. It provides a standard way to implement a PropertyEditor by extending the functionalities of PropertyEditorSupport. The main principle is about custom editor which can be created only when first need (with create an init customEditor), in order to save large amount of memory.
| Field Summary | |
protected java.awt.Component |
customEditor
the graphical UI used to edit value. |
protected java.lang.Object |
value
the internaly stored value. |
| Constructor Summary | |
XoAbstractPropertyEditor()
Creates a new instance of XoAbstractPropertyEditor. |
|
| Method Summary | |
protected abstract void |
createCustomEditor()
This method informs this to create the graphical UI to edit the value. |
protected abstract java.lang.Object |
createValue(java.lang.String str)
Creates an instance of value object by converting string param str. |
java.lang.String |
getAsText()
Returns current value as string representation |
java.awt.Component |
getCustomEditor()
Returns the custom editor UI, by creating it at first call of this method. |
java.lang.Object |
getValue()
returns the internaly stored value. |
protected abstract void |
initCustomEditor()
This method informs this to init or reinit the graphical UI previously created by createCustomEditor(). |
boolean |
isPaintable()
by default, return false. if derived class returns true, it must also implement paintValue() from PropertyEditor interface. |
void |
setAsText(java.lang.String str)
Sets value with result of converting param str as object, by createValue() |
protected abstract void |
setCustomEditorValue()
This method informs this to setup the graphical UI with current value. |
void |
setProperty(XoProperty p)
Sets the property possibly using this editor. |
void |
setValue(java.lang.Object obj)
Sets value with obj and sets customEditor also if created |
boolean |
supportsCustomEditor()
This class supports customEditor |
| Methods inherited from class java.beans.PropertyEditorSupport |
addPropertyChangeListener, firePropertyChange, getJavaInitializationString, getTags, paintValue, removePropertyChangeListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.beans.PropertyEditor |
addPropertyChangeListener, getJavaInitializationString, getTags, paintValue, removePropertyChangeListener |
| Field Detail |
protected java.lang.Object value
protected java.awt.Component customEditor
| Constructor Detail |
public XoAbstractPropertyEditor()
| Method Detail |
protected abstract java.lang.Object createValue(java.lang.String str)
throws java.lang.IllegalArgumentException
str - the string to convert into value
java.lang.IllegalArgumentException - if str is not convertibleprotected abstract void createCustomEditor()
protected abstract void initCustomEditor()
protected abstract void setCustomEditorValue()
public java.lang.String getAsText()
getAsText in interface java.beans.PropertyEditorpublic void setProperty(XoProperty p)
setProperty in interface XoPropertyEditorp - the property wrapperpublic java.awt.Component getCustomEditor()
getCustomEditor in interface java.beans.PropertyEditorpublic java.lang.Object getValue()
getValue in interface java.beans.PropertyEditorpublic boolean isPaintable()
isPaintable in interface java.beans.PropertyEditor
public void setAsText(java.lang.String str)
throws java.lang.IllegalArgumentException
setAsText in interface java.beans.PropertyEditorjava.lang.IllegalArgumentExceptionpublic void setValue(java.lang.Object obj)
setValue in interface java.beans.PropertyEditorpublic boolean supportsCustomEditor()
supportsCustomEditor in interface java.beans.PropertyEditor
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||